import request from '@/router/axios';
import {baseUrl} from "../../config/env";

export const getPage = (current, size, params) => {
  return request({
    url: baseUrl + '/api-user/dept/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const remove = (ids) => {
  return request({
    url: baseUrl + '/api-user/dept/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const create = (row) => {
  return request({
    url: baseUrl + '/api-user/dept/create',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: baseUrl + '/api-user/dept/update',
    method: 'post',
    data: row
  })
}


export const getDept = (id) => {
  return request({
    url: baseUrl + '/api-user/dept/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
export const getDeptTree = () => {
  return request({
    url: baseUrl + '/api-user/dept/tree',
    method: 'get'
  })
}

export const getTenantList = () => {
  return request({
    url: baseUrl + '/api-user/tenant/tenantList',
    method: 'get'
  })
}

